﻿using System;
using System.Collections.Generic;
using UnityEngine;
using XLua;
[LuaCallCSharp]
public class LuaBase : MonoBehaviour 
{
    public object data;

    public Action luaStart;
    public Action luaUpdate;
    public Action luaOnDestroy;
    public Action<Collision2D> luaOnCollisionEnter;//碰撞回调
    public Action<Collision2D> luaOnCollisionExit;//碰撞回调

    public LuaTable table;

    public string bundleName;
    public string assetName;
   
    private void Start()
    {
        luaStart?.Invoke();
    }
    private void Update()
    {
        luaUpdate?.Invoke();
    }
    private void OnDestroy()
    {
        luaOnDestroy?.Invoke();
    }
    private void OnCollisionEnter2D(Collision2D collision)
    {
        luaOnCollisionEnter?.Invoke(collision);
    }
    private void OnCollisionExit2D(Collision2D collision)
    {
        luaOnCollisionExit?.Invoke(collision);
    } 
}
